<!DOCTYPE html>
<meta charset="UTF-8">
<body>
<iframe
  id="iframe"
  srcdoc="<span id='span-iframe'>abc</span>"
  >
</iframe>
<br>
<span id="span-doc">abc</span>